[colors]
include-file = $HOME/git/dotfiles/themes/current/polybar/colors

[default]
background = ${colors.background}
foreground = ${xrdb:foreground}

font-0 = lucy tewi2a:pixelsize=11;2
font-1 = IPAGothic:pixelsize=11;2
font-2 = Hack Nerd Font:pixelsize=11;3

; Font used for left
font-3 = Hack Nerd Font:pixelsize=14;3
font-4 = Wuncon Siji:pixelsize=11;2

monitor = eDP-1

wm-restack = bspwm
override-redirect = true

[bar/top]
inherit = default

width = 100%
height = 30

offset-x = 0
offset-y = 0

line-size = 2

padding = 0
override-redirect = false

module-margin-right = 0

modules-left = recording
modules-center = bspwm
modules-right = cpu memory temps volume date power

cursor-click = pointer
cursor-scroll = ns-resize

tray-position = none
tray-padding = 2
tray-detached = false
tray-maxsize = 16
tray-background = ${xrdb:background}
tray-offset-x = 0
tray-offset-y = 0
tray-scale = 1.0

[bar/bottom]
inherit = default

bottom = true

override-redirect = false

font-0 = Fantasque Sans Mono:pixelsize=11;3

width = 100%
height = 20

padding = 2

modules-left = wifi
modules-center = filesystem
modules-right = battery

tray-position = none

[module/workspace]
type = internal/xworkspaces
pin-workspaces = true

icon-0 = browser;
icon-1 = terminal;
icon-2 = file;
icon-3 = music;
icon-4 = chat;
icon-5 = code;
icon-6 = steam;
icon-7 = vm;

ws-icon-default = ♟

label-active = %icon%
label-active-foreground = ${colors.background}
label-active-background = ${colors.foreground}
label-active-padding = 2

label-occupied = %icon%
label-occupied-foreground = #ffffff
label-occupied-padding = 2

label-empty = %icon%
label-empty-foreground = ${xrdb:color6}
label-empty-padding = 2

[module/bspwm]
type = internal/bspwm
pin-workspaces = true

ws-icon-0 = browser;
ws-icon-1 = terminal;
ws-icon-2 = file;
ws-icon-3 = music;
ws-icon-4 = chat;
ws-icon-5 = code;
ws-icon-6 = steam;
ws-icon-7 = vm;

ws-icon-default = ♟

label-focused = %icon%
label-focused-foreground = #fff
label-focused-underline = #fff
label-focused-padding = 2

label-occupied = %icon%
label-occupied-foreground = #fff
label-occupied-padding = 2

label-empty = %icon%
label-empty-padding = 2

[module/arch]
type = custom/text

content = "%{T4} %{T-}"
content-background = ${xrdb:color2}
content-foreground = #02020e

[module/right]
type = custom/text

content = "%{F#aababc}%{B#aababc F#0c0f16} %{B-}%{F-}"

[module/fill]
type = custom/text

content = "%{B#1a1512} "

[module/filesystem]
type = internal/fs

mount-0 = /

format-mounted = " <bar-used>"
format-mounted-padding = 1
format-mounted-background = ${default.background}

bar-used-fill-foreground = ${xrdb:color2}
bar-used-empty-foreground = #ffffff
bar-used-gradient = true
bar-used-width = 10
bar-used-indicator =
bar-used-fill = ﭳ
bar-used-empty = ﭳ

; Seconds to sleep between updates
; Default: 30
interval = 10

; Display fixed precision values
; Default: false
fixed-values = true

[module/battery]
type = internal/battery

full-at = 99

battery = BAT0
adapter = AC

poll-interval = 1

format-charging = <animation-charging><label-charging>
format-charging-background = ${default.background}
label-charging = " %percentage%% "

format-discharging = <ramp-capacity><label-discharging>
format-discharging-background = ${default.background}
label-discharging = " %percentage%% "

format-full-background = ${default.background}
label-full = " %{F#90EE90} %{F-}%percentage%% "

ramp-capacity = 100

animation-charging-0 = " "
animation-charging-1 = " "
animation-charging-2 = " "
animation-charging-3 = " "
animation-charging-4 = " "
animation-charging-framerate = 750

animation-discharging-0 = " "
animation-discharging-1 = " "
animation-discharging-2 = " "
animation-discharging-3 = " "
animation-discharging-4 = " "
animation-discharging-framerate = 750

ramp-capacity-0 = " "
ramp-capacity-1 = " "
ramp-capacity-2 = " "
ramp-capacity-3 = " "
ramp-capacity-4 = " "
[module/cpu]
type = internal/cpu
interval = 5
format-background = ${colors.background}
label = "  %percentage%% "

[module/memory]
type = internal/memory
interval = 5
label = "  %percentage_used%% "

[module/network]
type = internal/network
interface = wlp6s0
interval = 3.0

format-connected = <label-connected>
format-disconnected = <label-disconnected>

label-connected = " %{F#ff5555}%{F-} %downspeed% %{F#55ff55}%{F-} %upspeed% %signal%% "

label-disconnected = desconectado

[module/wifi]
type = internal/network
interface = wlp6s0
interval = 3.0

format-connected = <label-connected>
format-disconnected = <label-disconnected>

label-connected-background = ${default.background}
label-connected = "%ifname% %local_ip% %{F#ff5555} %{F-} %downspeed% %{F#55ff55}%{F-} %upspeed%  %signal%% "

label-disconnected = " offline "

[module/temp]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60

format = <ramp> <label>
format-background = ${colors.background}

format-warn = <ramp> <label-warn>

label = "%{F#ffff55}%{F-} %temperature% "
label-warn = " %temperature% "

ramp-0 = 
ramp-1 = 
ramp-2 = 

[module/temps]
type = custom/script

format-prefix = "%{F#ffff55}%{F-} "
exec = sensors | grep Core | awk '{print substr($3, 2, length($3)-5)}' | tr "\\n" " " | sed 's/ /°C /g' | sed 's/  $//'

interval = 1

[module/date]
type = internal/date
interval = 5

format-background = ${colors.background}

date = "%d/%m/%Y"
date-alt = "%A %b de %Y"

time = %H:%M

label =  %date% %time%
format-padding = 1

[module/volume]
type = internal/alsa

format-volume = <ramp-volume> <label-volume>
format-volume-padding = 1
format-volume-background = ${colors.background}
label-volume = %percentage:3%%

format-volume-muted = <label-muted>
format-volume-muted-background = ${colors.background}
label-muted = 
label-muted-padding = 1

ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 

[module/power]
type = custom/menu

label-open = " "
label-close = 
label-separator = 
label-padding = 1

expand-right = false

format-padding = 1
format-background = ${colors.background}
; format-background = "${xrdb:color3}"

menu-0-0 = Exit
menu-0-0-exec = menu-open-1

menu-0-1 = Suspend
menu-0-1-exec = menu-open-2

menu-0-2 = Reboot
menu-0-2-exec = menu-open-3

menu-0-3 = Shutdown
menu-0-3-exec = menu-open-4

menu-1-0 = "Confirm exit?"
menu-1-0-exec = bspc quit

menu-2-0 = "Confirm suspend?"
menu-2-0-exec = systemctl suspend

menu-3-0 = "Confirm reboot?"
menu-3-0-exec = systemctl reboot

menu-4-0 = "Confirm shutdown?"
menu-4-0-exec = systemctl poweroff


[module/decor-glyph]
type = custom/text
content-background = #8c02020e
content-foreground = ${xrdb:color6}

[module/left-end-top]
inherit = module/decor-glyph
content = "%{T4}%{T-}"

[module/right-end-top]
inherit = module/decor-glyph
content = "%{T4}%{T-}"

[module/left-end-bottom]
inherit = module/decor-glyph
content = "%{T4}%{T-}"

[module/right-end-bottom]
inherit = module/decor-glyph
content = "%{T4}%{T-}"

[module/recording]
type = custom/script

exec = echo "  "

exec-if = pgrep -f "ffmpeg.*x11grab"

tail = true

[module/hackspeed]
type = custom/script
exec = ~/.config/polybar/scripts/hack.sh
tail = true

[settings]
screenchange-reload = true

format-background = ${colors.background}

throttle-output = 5
throttle-output-for = 10

throttle-input-for = 30

;compositing-background = source
;compositing-foreground = over
;compositing-overline = over
;compositing-underline = over
;compositing-border = over

pseudo-transparency = true

; vim: set ft=cfg: fen fdm=marker
